package cn.yx.common.security.webmvc.annotation;

import cn.yx.common.security.service.JwtTokenService;
import cn.yx.common.security.service.JwtUserDetailsServiceImpl;
import cn.yx.common.security.service.SecurityCodeService;
import cn.yx.common.security.webmvc.access.CustomInvocationSecurityMetadataSource;
import cn.yx.common.security.webmvc.configuration.SecurityConfiguration;
import cn.yx.common.security.webmvc.controller.AuthController;
import cn.yx.common.security.webmvc.filter.JwtAuthenticationFilter;
import cn.yx.common.security.webmvc.filter.VerifyCodeAuthenticationFilter;
import cn.yx.common.security.webmvc.handler.CustomAccessDeniedHandler;
import cn.yx.common.security.webmvc.handler.CustomAuthenticationFailureHandler;
import cn.yx.common.security.webmvc.handler.CustomAuthenticationSuccessHandler;
import cn.yx.common.security.webmvc.manager.CustomAccessDecisionManager;
import cn.yx.common.security.webmvc.sms.SmsCodeAuthenticationProvider;
import org.springframework.context.annotation.Import;

import java.lang.annotation.*;

/**
 * <p>启用Mvc的Security功能</p>
 *
 * @author Wgssmart
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Import({
        SecurityConfiguration.class,
        CustomInvocationSecurityMetadataSource.class,
        JwtAuthenticationFilter.class,
        VerifyCodeAuthenticationFilter.class,
        CustomAccessDecisionManager.class,
        CustomAccessDeniedHandler.class,
        CustomAuthenticationSuccessHandler.class,
        CustomAuthenticationFailureHandler.class,
        SmsCodeAuthenticationProvider.class,
        // SmsCodeAuthenticationFilter.class,
        JwtUserDetailsServiceImpl.class,
        JwtTokenService.class,
        SecurityCodeService.class,
        AuthController.class
})
public @interface EnableCustomWebMvcSecurity {

}
